OS = $(shell uname)

Linux_SONAME = so
Darwin_SONAME = dylib

include ../../makefile-paths

TARGET = IndexService.$($(OS)_SONAME)
CC = c++
OBJS = IndexService.o

Darwin_CFLAGS = -dynamic -DMACHINE_MACOSX -D_PTHREADS -mtune=970 -framework Lasso
Darwin_LFLAGS = -bundle
Darwin_LIBS = -lz -framework Lasso -framework CoreServices -framework ApplicationServices -licui18n -licuuc -licudata -licuio

Linux_CFLAGS = $(CAPI_INCLUDES)
Linux_LFLAGS = -shared -dynamic
Linux_LIBS = -Wl,-Bsymbolic -lz -lpthread

CFLAGS = $($(OS)_CFLAGS)
CPPFLAGS = $(CFLAGS)
LFLAGS = $($(OS)_LFLAGS) $($(OS)_LIBS)

$(TARGET): $(OBJS)
	$(CC) -o $@ $(OBJS) $(LFLAGS)

all: $(TARGET)

clean:
	- rm *.o *.so core *~ $(OBJ_DIR)/*.o *.a > /dev/null 2>&1
